import {RouteRecordRaw} from 'vue-router';

const routes: Array<RouteRecordRaw> = [
    {
        path:"/",
        redirect:"/home"
    },
    // 主页
    {
        path:"/home",
        name:'home',
        component:() => import('@/pages/home/index.vue')
    },
    {
        path:'/download',
        name:'download',
        component:() => import('@/pages/downLoad/index.vue')
    },
    {
        // 排行榜
        path:'/ranking',
        component: () => import('@/pages/ranking/index.vue')
    },
    {
        // 分类
        path:'/category',
        component:() => import('@/pages/category/index.vue')
    },
    {
        // 搜索
        path:'/search',
        name:'search',
        component:() => import('@/pages/search/index.vue')
    },
    {
        //登录
        path:'/login',
        name:'login',
        component:() => import('@/pages/login/index.vue')
    },
    {
        //听单
        path:'/listening',
        component:() => import('@/pages/listening/index.vue')
    },
    {
        //详情
        path:'/detail',
        component:() => import('@/pages/detail/index.vue')
    },
    
    {
        // 404
        path:'/404',
        component:() => import('@/pages/404/index.vue')
    },
    {
        //匹配任意路由组件
        path: "/:pathMatch(.*)",
        redirect: "/404"
    }


]



// 对外暴露
export default routes;